{include file="/wap/public/membertop" /}
{include file="/public/layui" /}
<body style="height: 429px;"><iframe id="chuang_frm" name="chuang_frm" style="display:none;"></iframe>
<section class="pageWrapper">
<header>
  <div class="left"><a id="goback" href="javascript:void(0)" title="返回"></a></div>
  <div class="title">提现申请</div>
    <div class="right"><a href="{:url('index/index')}" id="indexIco" title="首页"></a></div>
</header>
<section class="page_ucenter_box">
  <div class="introForm">
    <form method="post" action="" id="theForm" >
      <div class="regGroup clearfix">
        <label class="title">账户余额</label>
        <div class="control_txt"> {$user.amount}元 </div>
      </div>
      <div class="regGroup clearfix">
        <label class="title">提现金额</label>
        <div class="control_txt">
          <input type="text" name="money" class="text" placeholder="提现金额">
        </div>
      </div>
      <div class="regGroup clearfix">
        <label class="title">开户银行</label>
        <div class="control_txt">
          <input type="text" name="bank" class="text" value="{$user.bankname}" readonly  placeholder="开户银行">
        </div>
      </div>
      <div class="regGroup clearfix">
        <label class="title">开户账号</label>
        <div class="control_txt">
          <input type="text" name="card" class="text" value="{$user.bankcode}" readonly  placeholder="银行账号">
        </div>
      </div>
      <div class="regGroup clearfix">
        <label class="title">具体支行</label>
        <div class="control_txt">
          <input type="text" name="zhihang" class="text" value="{$user.bankaddress}" readonly  placeholder="具体支行">
        </div>
      </div>
      <div class="regGroup clearfix">
        <label class="title">开户名</label>
        <div class="control_txt">
          <input type="text" name="name"  value="{$user.bankrealname}" readonly  class="text" placeholder="开户名">
        </div>
      </div>
	   <div class="regGroup clearfix">
        <label class="title">预留手机号</label>
        <div class="control_txt">
          <input type="text" name="ylph"  value="{$user.bankylpo}" readonly  class="text" placeholder="预留手机号">
        </div>
      </div>
      <div class="regGroup clearfix">
        <input class="btn" type="button" name='submit' value="申请提现"> 
    
    </div>
	<div id="error" style="bottom: 12px;text-align: center;"><span class="error"></span></div>
    </form>
  </div>
</section>

  
</section>
<script>
$(function(){
 function loginsubmit(){
                var money=true;
                var card=true;
				var name=true;
               
var form=$('#theForm').serialize();

                if($('#theForm input[name=money]').val() == ''){
                   // $('#error').html('<span class="error">!</span>');
					msg('金额不能为空');
                    $('#theForm input[name=money]').focus();
                    money = false;
                    return false;
                }

                if($('#theForm input[name=card]').val() == ''){
                   // $('#error').html('<span class="error"></span>');
					msg('账号不能为空');
                    $('#theForm input[name=card]').focus();
                    card = false;
                    return false;
                }
				 if($('#theForm input[name=name]').val() == ''){
                   // $('#error').html('<span class="error">开户名不能为空</span>');
					msg('开户名不能为空');
                    $('#theForm input[name=name]').focus();
                    name = false;
                    return false;
                }
				if($('#theForm input[name=card]').val() == ''){
                   // $('#error').html('<span class="error">开户名不能为空</span>');
					msg('开户账号不能为空!');
                    $('#theForm input[name=card]').focus();
                    name = false;
                    return false;
                }

               

                if( $('#theForm input[name=money]').val() != '' && $('#theForm input[name=paytype]').val() != ''){
                    $.ajax({
                        async:false,
                        url:"{:url('user/usertx')}",
                        data:form,
                        type:'post',
                        dataType:'json',
                        success:function(res){
							
                            if(res.status != 1){
                              
								msg(res.msg);
                               
                                money=false;
                                paytype=false;
                                return false;
                            }else{
								 msg(res.msg);
                              window.location.reload();  
                            }
                        },
                        error : function(XMLHttpRequest, textStatus, errorThrown) {
							
							msg('网络失败，请刷新页面后重试!');
                          
                        }
                    });
                }else{
                    return false;
                }
            }

           
            $('#theForm input[name=submit]').on('click',function(){
				
                loginsubmit();
            });
			
			
           
			
        });
</script>
{include file="/wap/public/memberhder" /}